package 数组;

public class Zuoye03144 {
    public static void main(String[] args) {
        int[] a = {8, 66, 110, 112, 114, 119, 101, 88};
        int[] c = new int[a.length];
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            c[i] = a[i];
        }
        for (int i = 0; i < a.length; i++) {
            for (int b = 0; b < a.length-1; b++) {
                if (a[b] >a[b + 1]) {
                    d = a[b];
                    a[b] = a[b + 1];
                    a[b + 1] = d;
                }
            }
        }
        System.out.println("排序后：");
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + "\t");
        }
        System.out.println("\n则位置信息是：");
        for (int i = 0; i < a.length; i++) {
            for (int b = 0; b < a.length; b++){
                if (c[b]==a[i]) {
                    System.out.print(b+",");
                }
            }
        }

    }
}
